using Script.Utilities;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using Utilities;

namespace Script
{
    public class SceneLoader : MonoBehaviour
    {
        [SerializeField] private GameObject jc;
        [SerializeField] private GameObject mainUI;
        [SerializeField] private Sprite hard;
        [SerializeField] private Sprite easy;
        [SerializeField] private Image image;
        void Awake()
        {
            PlayerSetting.difficulty = true;
        }

        public void OpenTutori()
        {
            jc.SetActive(!jc.activeSelf);
            mainUI.SetActive(!mainUI.activeSelf);
        }

        public void ChangeDifficulty()
        {
            PlayerSetting.difficulty = !PlayerSetting.difficulty;
            image.sprite = PlayerSetting.difficulty ? easy : hard;
        }
        public static void StartGame()
        {
            
            SceneManager.LoadSceneAsync("HUDScene");
            // 加载主场景
            SceneManager.LoadSceneAsync("MainScene",LoadSceneMode.Additive);
            // 如果需要加载多个场景（Additive 模式）
           
        }

        public static void BackToMenu()
        {
            SceneManager.LoadSceneAsync("InitScene");
        }
    }
}